﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SSCCMembership
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            ContentLoader.DependanciesLoader = new ExternalDependanciesLoader();
            var Log = new SSCCMembership.Views.LoginView();
            ContentLoader.UpdateContent(Log);
            Log.LoggedIn += new EventHandler(Log_LoggedIn);
            App.LayoutRoot = this.LayoutRoot;
        }

        void Log_LoggedIn(object sender, EventArgs e)
        {
            ContentLoader.UpdateContent("SSCCMembershipContent.xap", 0, "SSCCMembershipContent.dll", "SSCCMembershipContent.MainPage");
        }

        public void Logout()
        {
            var Log = new SSCCMembership.Views.LoginView();
            ContentLoader.UpdateContent(Log);
            Log.LoggedIn += new EventHandler(Log_LoggedIn);
        }
    }
}
